﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Ciloci.Flee;
using System.Diagnostics;

namespace WindowsFormsApplication3
{
    public partial class Form1 : Form
    {
        ExpressionContext ctx = null;
        IGenericExpression<double> expression = null;

        public Form1()
        {
            InitializeComponent();
        }

        private void buttonX1_Click(object sender, EventArgs e)
        {
            ctx = new ExpressionContext();
            ctx.Options.EmitToAssembly = true;
            expression = ctx.CompileGeneric<double>(textBoxX1.Text);
        }

        private void buttonX2_Click(object sender, EventArgs e)
        {
            textBoxX2.Text = expression.Evaluate().ToString();
        }

        private void buttonX3_Click(object sender, EventArgs e)
        {
            Process.Start(@"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\x64\ildasm.exe", @"C:\dev\own\AppFx\baseappfx\WindowsFormsApplication3\bin\Debug\FleeExpression.dll");
        }

        private void buttonX4_Click(object sender, EventArgs e)
        {
            Process.Start(@"E:\dev\IlSpy\ilspy.exe", @"C:\dev\own\AppFx\baseappfx\WindowsFormsApplication3\bin\Debug\FleeExpression.dll");
        }
    }
}
